/**
 * @author : zzr
 * @description :
 * @date :
 */
class MyArray {
    Object[] array = new Object[10];

    public Object getArray(int pos) {
        return array[pos];
    }

    public void setArray(int pos, Object val) {
        array[pos] = val;
    }
}
class MyArray2<T> {
    public Object[] array = new Object[10];
    public T getArray(int pos) {
        return (T)array[pos];
    }

    public void setArray(int pos, Object val) {
        array[pos] = val;
    }
}
public class Test2 {

    public static void main(String[] args) {
        MyArray2<String> myArray2 = new MyArray2<>();
        myArray2.setArray(0,"hello");
        String str = myArray2.getArray(0);
        System.out.println(str);myArray2.setArray(1,10);//在下标为1的位置插入整型10

        String str2 = myArray2.getArray(1);

        System.out.println(str2);
    }
    public static void main2(String[] args) {
         MyArray myArray = new MyArray();
         myArray.setArray(0,"hello");
         myArray.setArray(1,3);
         String str = (String)myArray.getArray(0);
        System.out.println(str);
    }
    public static void main1(String[] args) {

        Integer a = 127;
        Integer b = 127;
        System.out.println(a == b);

        Integer c = 128;
        Integer d = 128;
        System.out.println(c == d);
        int e = Integer.valueOf(a);
    }
}
